<?php
$NewsletterForm = '<?php
class NewsletterForm extends Zend_Form
{
	public function __construct( $options = null )
    {
        parent::__construct( $options );
        $this->setName( \'newsletter\' );    
		
        $imie = new Zend_Form_Element_Textarea( strNlNewsletter::nl_imie );
        $imie->setLabel(\'Imię: \')
  				->setAttribs(array(\'rows\' => \'1\', \'cols\' => \'40\'))
        ;
        $email = new Zend_Form_Element_Textarea( strNlNewsletter::nl_email );
        $email->setLabel(\'Adres e-mail: \')
  				->setAttribs(array(\'rows\' => \'1\', \'cols\' => \'40\'))
  				->addValidator(new Zend_Validate_EmailAddress())
        ;
        $submit = new Zend_Form_Element_Submit(\'Zapisz\');
		
		$anuluj = new Zend_Form_Element_Button(\'Anuluj\');
		$anuluj->setAttrib( \'onClick\',  \'document.location = "CMS,Newsletter,Listuj_adresy_email,1.html"; \' );
		
        $this->addElements(array( $imie, $email, $submit, $anuluj) );

		//--pobieranie elementów formularza
		$elementy = $this->getElements();
		
		//--Dodawanie dekoratorów do elementów formularza        
		foreach ($elementy as $variable) {
		   
		if ($variable==$submit||$variable==$reset||$variable==$anuluj)
				$variable->setDecorators(array( \'ViewHelper\', \'Description\', \'Errors\',
				array(array(\'data\'=>\'HtmlTag\'), array(\'tag\' => \'td\')) 
			));		
				   
		else
				$variable->setDecorators(array( \'ViewHelper\', \'Description\', \'Errors\',
						   array(array(\'data\'=>\'HtmlTag\'), array(\'tag\' => \'td\')),
						   array(\'Label\', array(\'tag\' => \'td\')),	                   
						   array(array(\'row\'=>\'HtmlTag\'),array(\'tag\'=>\'tr\'))
				));
		}

		//--Dodawanie dekoratora dla całego formularza        
		$this->setDecorators(array(
				  \'FormElements\',
				   array(array(\'data\'=>\'HtmlTag\'),array(\'tag\'=>\'table\')),
				   \'Form\'
		));		
    }
}
';


$defaultNewsletterController = '<?php
class NewsletterController extends Zend_Controller_Action
{
    public function init()
    {
		$this->_helper->layout->setLayoutPath(APPLICATION_PATH.\'/modules/default/layouts\');
		$bUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
		// dojo...
        Zend_Dojo::enableView( $this->view );
        Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
		$this->view->dojo()->setDjConfigOption( \'usePlainJson\', true )
      					   ->setDjConfigOption( \'parseOnLoad\', true )
      					   ->addStylesheetModule( \'dijit.themes.tundra\' )
      					   ->setLocalPath( $bUrl.\'/js/dojo/dojo/dojo.js\' )
      					   //->addLayer($bUrl.\'/js/dojo/dojo/dajana.js\')
      	    			   ;

     	$this->view->dojo()->disable();
     	
    }
    
    public function dodajemailAction()
    {
        $newsletter = new strNlNewsletter();
        if ( $this->_request->isPost() )
    	{
    		$formData = $this->_request->getPost();
 		
			$validator = new Zend_Validate_EmailAddress();
			if($validator->isValid($formData[nl_email])) 
			{
				$newsletter->zInsert( $formData );
				$this->view->czydodano = \'<h4>Dodano adres e-mail</h4>\';
			}
			else {
				$this->view->czydodano = \'<h4>Błędny adres e-mail</h4>\';
			}
    		
    	}
    }
    
    
}
';



$defaultHelperDodajEmail = '<?php
class Zend_View_Helper_DodajEmail  extends Zend_View_Abstract
{
	protected function _run()
	{
	}
	
	public function DodajEmail( )
	{
		echo 
		\'<div style="width: 210px; border: solid lightgray 1px; padding: 10px; float: right; clear: right;">\'.
		\'<h4>Newsletter</h4>\'.
		\'<form action="\'.$this->url(array(),\'defaultNewsletterDodajemail\').\'" method="POST">\'.
		\'<label>imię:</label><br />\'.
		\'<input type="text" name="nl_imie" value="" style="width: 200px;"/><br />\'.
		\'<label>adres e-mail:</label><br />\'.
		\'<input type="text" name="nl_email" value="" style="width: 200px;"/><br />\'.
		\'<input type=submit value="Zapisz">\'.
		\'</form></div>\';
	}

    public function friendlyUrl( $name )
    { 	
		return str_replace(
							array(" - "," ","-",".",",",";","ą", "ć", "ę", "ł", "ń", "ó", "ś", "ź", "ż", "Ą", "Ć", "Ę", "Ł", "Ń", "Ó", "Ś", "Ź", "Ż"),
							array("_","_","_","","","","a", "c", "e", "l", "n", "o", "s", "z", "z", "A", "C", "E", "L", "N", "O", "S", "Z", "Z"),
		 					$name
		 				  );
    }

}
';


$defaultDodajemail_phtml = '
<div style="width: 210px; border: solid lightgray 1px; padding: 10px; float: right; clear: right;">
<?php echo $this->czydodano; ?>
<a href="javascript:history.back()">Powrót</a>
</div>
';


$cmsNewsletterController = '<?php
class cms_NewsletterController extends Zend_Controller_Action
{
    public function init()
    {
		$this->_helper->layout->setLayoutPath(APPLICATION_PATH.\'/modules/cms/layouts\');
		$bUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
		// dojo...
        Zend_Dojo::enableView( $this->view );
        Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
		$this->view->dojo()->setDjConfigOption( \'usePlainJson\', true )
      					   ->setDjConfigOption( \'parseOnLoad\', true )
      					   ->addStylesheetModule( \'dijit.themes.tundra\' )
      					   ->setLocalPath( $bUrl.\'/js/dojo/dojo/dojo.js\' )
      					   //->addLayer($bUrl.\'/js/dojo/dojo/dajana.js\')
      	    			   ;

     	$this->view->dojo()->disable();
     	
    }
    
    public function aktualnosciadresyAction()
    {
 		$this->view->tytul = \'Newsletter\';
    	$this->view->headTitle( $this->view->tytul );
    	$this->view->pid = \'newsletter\';   	
    }
    
	public function listujaktualnoscinewsletterAction()
	{
		
		$this->view->tytul = \'Newsletter\';
    	$this->view->headTitle( $this->view->tytul );
    	$this->view->pid = \'newsletter\';
		$aktualnosci= new strAktualnosci();
    	$rowCount = 2; 
    	$pgNum = $this->_getParam( \'page\' );
    	$result = $aktualnosci->selectAll($pgNum, $rowCount);
		$paginator = Zend_Paginator::factory( $result );
		$paginator->setCurrentPageNumber( $pgNum );
		$paginator->setItemCountPerPage( $rowCount );
		$paginator->setPageRange( 10 );
		$this->view->paginator = $paginator;
		
	}
	
	public function podgladwiadomosciAction()
	{
		$this->view->tytul = \'Newsletter\';
    	$this->view->headTitle( $this->view->tytul );
    	$this->view->pid = \'newsletter\';
    	$id = $this->_getParam( \'id\' );
    	$strAktualnosci = new strAktualnosci();
    	$aktualnosc = $strAktualnosci -> selectOne($id);
    	$this->view->tresc = $aktualnosc[strAktualnosci::akt_tresc];
   		$this->view->tytul = $aktualnosc[strAktualnosci::akt_tytul];
   		$this->view->id = $id;
		
	}
  
	public function wyslijwiadomoscAction()
	{
		$newsletter = new strNlNewsletter();
		$listaadresow = $newsletter->selectAll();
    	$id = $this->_getParam( \'id\' );
    	$strAktualnosci = new strAktualnosci();
    	$aktualnosc = $strAktualnosci -> selectOne($id);
   		$mail = new Zend_Mail(\'UTF-8\');
		$mail->setBodyText($aktualnosc[strAktualnosci::akt_tresc]);
		$mail->setFrom(\'nadawca@gmail.com\', \'Nadawca\');
		foreach ($listaadresow as $adres)
		{
			$mail->addTo($adres[strNlNewsletter::nl_email], $adres[strNlNewsletter::nl_imie]);
		}
		$mail->setSubject($aktualnosc[strAktualnosci::akt_tytul]);
		//print_r($mail);die();
		$mail->send();

		$aktualnosc[strAktualnosci::akt_newsletter_status] = \'wysłane\';
    	$strAktualnosci->zUpdate( $id, $aktualnosc );
		
    	$this->_redirect(\'CMS,Newsletter,Listuj_aktualnosci,1.html\');
	}

	public function listujadresyemailAction()
	{
		
		$this->view->tytul = \'Newsletter\';
    	$this->view->headTitle( $this->view->tytul );
    	$this->view->pid = \'newsletter\';
		$newsletter = new strNlNewsletter();
    	$rowCount = 2; 
    	$pgNum = $this->_getParam( \'page\' );
    	$result = $newsletter->selectAll($pgNum, $rowCount, array(),array(),array(strNlNewsletter::nl_email));
		$paginator = Zend_Paginator::factory( $result );
		$paginator->setCurrentPageNumber( $pgNum );
		$paginator->setItemCountPerPage( $rowCount );
		$paginator->setPageRange( 10 );
		$this->view->paginator = $paginator;
	}		
	
	public function usunadresemailAction()
	{
		$newsletter = new strNlNewsletter();
		$newsletter->zDelete( $this->_getParam(\'id\') );
		$this->_redirect(\'CMS,Newsletter,Listuj_adresy_email,1.html\');
	}  
   	public function edytujadresemailAction()
	{
  	   	$newsletter = new strNlNewsletter();
    	$news = $newsletter->selectOne( $this->_getParam(\'id\') );
	   	$this->view->tytul = \'Newsletter - \'.$news[ strNlNewsletter::nl_email ];
    	$this->view->headTitle( $this->view->tytul );
    	$this->view->id = $news[strNlNewsletter::nl_id];
    	$form = new NewsletterForm();
    	$this->view->form = $form;
        if ( $this->_request->isPost() )
    	{
    		$formData = $this->_request->getPost();
    		if($form->isValid($formData))
			{    		
    			$newsletter->zUpdate( $this->_getParam(\'id\'), $formData );
    			$this->_redirect(\'CMS,Newsletter,Listuj_adresy_email,1.html\');
			}
    	}
    	else
    	{
    		$form->populate( $news );
    	}
    	$this->view->pid = \'newsletter\';
    }  
  
	public function dodajadresemailAction()
	{
        $newsletter = new strNlNewsletter();
    	$form = new NewsletterForm();
    	$this->view->form = $form;
        if ( $this->_request->isPost() )
    	{
    		$formData = $this->_request->getPost();
			if($form->isValid($formData))
			{
    			$newsletter->zInsert( $formData );
				$this->_redirect(\'CMS,Newsletter,Listuj_adresy_email,1.html\');
			}
		}
    	$this->view->tytul = \'Newsletter - Dodaj adres e-mail\';
    	$this->view->headTitle( $this->view->tytul );
		$this->view->pid = \'newsletter\';
	}
			
}

';



$adresy_listing_phtml = '
<tr style="width: 430px;" onMouseOver="this.style.background=\'#e5e5e5\'" onMouseOut="this.style.background=\'\'">
<?php
			echo \'<td style="text-align: left; padding: 10px; width: 70px;">\'.$this->{strNlNewsletter::nl_imie}.\'</td>\'.
			\'<td style="text-align: left; padding-left: 10px;width: 150px;">\'.$this->{strNlNewsletter::nl_email}.\'</td>\'.
			\'<td style="text-align: center;width: 50px;">\';
			
				echo $this->AclMenuOtherHelper(\'newsletter\',1,$this->{\'acl\'},$this->{strNlNewsletter::nl_id});
				echo $this->AclMenuOtherHelper(\'newsletter\',2,$this->{\'acl\'},$this->{strNlNewsletter::nl_id});
			echo \'</td>\';
			
			//echo \'<a href="\'.$this->url(array($this->{strNlNewsletter::nl_id}),\'cmsNewsletterEdytujadresemailAction\').\'"><img alt="Edytuj" src="\'.$this->baseUrl().\'/files/img_panel/pencil.png" style="border: 0; padding-right: 10px;" /></a>\'.
			//\'<a href="\'.$this->url(array($this->{strNlNewsletter::nl_id}),\'cmsNewsletterUsunadresemailAction\').\'"><img alt="Usuń" src="\'.$this->baseUrl().\'/files/img_panel/ico_kosz.gif" style="border: 0; padding-right: 10px;" /></a>\'.
			//\'</td>\';
?>
</tr>
';

$aktualnoscinewsletter_listing_phtml = '
<tr style="width: 630px;" onMouseOver="this.style.background=\'#e5e5e5\'" onMouseOut="this.style.background=\'\'">
<?php
			echo \'<td style="text-align: left; padding: 10px; width: 300px;">\'.$this->{strAktualnosci::akt_tytul}.\'</td>\'.
			\'<td style="text-align: center;width: 110px;">\'.$this->{strAktualnosci::akt_insd}.\'</td>\'.
			\'<td style="text-align: center;width: 100px;">\'.$this->{strAktualnosci::akt_newsletter_status}.\'</td>\'.
			\'<td style="text-align: center;width: 100px;">\';
			
				echo $this->AclMenuOtherHelper(\'newsletter\',4,$this->{\'acl\'},$this->{strAktualnosci::akt_id});
			echo \'</td>\';
			//\'<a href="\'.$this->url(array($this->{strAktualnosci::akt_id}),\'cmsNewsletterPodgladwiadomosciAction\').\'"><img alt="" title="Wyślij" src="\'.$this->baseUrl().\'/files/img_panel/mail.gif" style="border: 0; padding-right: 10px;" /></a>\'.
			//\'</td>\';
?>
</tr>
';


$podgladwiadomosci_phtml = '
<h3>Podgląd wiadomości</h3>
<?php
	echo \'<h4>Temat:</h4>\'.$this->tytul;
	echo \'<h4>Treść:</h4>\'.$this->tresc;
?>

<br /><br />

<form style="clear: left; float: left;" action="<?php echo $this->url(array($this->id),\'cmsNewsletterWyslijWiadomoscAction\') ?>" method="POST">
<input type=submit value="Wyślij do adresatów">
</form>

<form action="javascript:history.back()" method="POST"">
<input type=submit value="Anuluj" >
</form>
';


$listujaktualnoscinewsletter_phtml = '
<table style="width: 630px; float: left; margin-left: 5px; margin-top: 15px; border: 1px solid #bfbfbf; text-align: center;" rules="all"; >
	<tr style="background:rgb(172,172,170);width:100%;">
		<th> Tytuł aktualności </th>
		<th> Utworzono </th>
	     <th> Status </th>
	     <th>  </th>
	</tr>
	<?php
			echo $this->partialLoop(\'_partials/aktualnoscinewsletter-listing.phtml\',  $this->ListTableP(strAktualnosci::CLASS_name,$this->paginator, $this->acl) );
	?>
</table>

<div style="clear: both">
<?php echo $this->paginationControl( $this->paginator, \'Sliding\', \'p.phtml\' );?>
</div>
';


$listujadresyemail_phtml = '
<form action="\'.$this->url(array(),\'defaultNewsletterDodajemail\').\'" method="POST">

<table style="width: 430px; float: left; margin-left: 5px; margin-top: 15px; border: 1px solid #bfbfbf; text-align: center;" rules="all"; >
	<tr style="background:rgb(172,172,170);width:100%;">
		<th> Imię </th>
		<th> Adres e-mail </th>
	     <th> </th>
	</tr>
	<?php
			echo $this->partialLoop(\'_partials/adresy-listing.phtml\',  $this->ListTableP(strNlNewsletter::CLASS_name,$this->paginator, $this->acl) );
	?>
</table>

</form>

<div style="clear: both">
<?php echo $this->paginationControl( $this->paginator, \'Sliding\', \'p.phtml\' );?>
</div>

<?php 		
	
	echo $this->AclMenuOtherHelper(\'newsletter\',3,$this->acl);
	
	//echo 
	//\'<div style="clear: both; padding-top: 10px; "><a href="\'.
	//$this->url(array( ),\'cmsNewsletterDodajadresemailAction\').
	//\'"><img alt="Dodaj adres e-mail" src="\'.$this->baseUrl().\'/files/img_panel/dodajstrone.jpeg" style="border: 0; float: left;" /></a>
	//<a href="\'.
	//$this->url(array( ),\'cmsNewsletterDodajadresemailAction\').
	//\'"><p style="padding-top: 5px; color: gray; font-size: 13px; font-weight: bold;">Dodaj adres e-mail</p></a></div>\';	
	
?>

';

$aktualnosciadresy_phtml = '
<h3><a href="<?php echo $this->url(array(\'page\' => 1),\'cmsNewsletterListujAktualnosciNewsletterAction\') ?>">Lista aktualności</a></h3>
<h3><a href="<?php echo $this->url(array(\'page\' => 1),\'cmsNewsletterListujAdresyEmailAction\') ?>">Lista adresów e-mail</a></h3>
';



$defaultNewsletterRouters = '<?php

#Newsletter.html
$r[ \'defaultNewsletterDodajemail\' ] = new Zend_Controller_Router_Route_Regex(
	\'Newsletter.html\',
    array( \'action\' => \'dodajemail\', \'controller\' => \'newsletter\', \'module\' => \'default\' ),
    array(  ),
	\'Newsletter.html\'
);

$router->addRoutes( $r );
';



$cmsNewsletterRouters = '<?php

#CMS,Newsletter,Aktualnosci_Adresy.html
$r[\'cmsNewsletterAktualnosciAdresyAction\'] = new Zend_Controller_Router_Route_Regex(
	\'CMS,Newsletter,Aktualnosci_Adresy.html\',
    array( \'action\' => \'aktualnosciadresy\', \'controller\' => \'newsletter\', \'module\' => \'cms\' ),
    array(  ),
	\'CMS,Newsletter,Aktualnosci_Adresy.html\'
);

#CMS,Newsletter,Listuj_aktualnosci,1.html
$r[\'cmsNewsletterListujAktualnosciNewsletterAction\'] = new Zend_Controller_Router_Route_Regex(
	\'CMS,Newsletter,Listuj_aktualnosci,([^-]*)\.html\',
    array( \'action\' => \'listujaktualnoscinewsletter\', \'controller\' => \'newsletter\', \'module\' => \'cms\' ),
    array( 1 => \'page\' ),
	\'CMS,Newsletter,Listuj_aktualnosci,%d.html\'
);

#CMS,Newsletter,Podglad_wiadomosci,1.html
$r[\'cmsNewsletterPodgladWiadomosciAction\'] = new Zend_Controller_Router_Route_Regex(
	\'CMS,Newsletter,Podglad_wiadomosci,([^-]*)\.html\',
    array( \'action\' => \'podgladwiadomosci\', \'controller\' => \'newsletter\', \'module\' => \'cms\' ),
    array( 1 => \'id\' ),
	\'CMS,Newsletter,Podglad_wiadomosci,%d.html\'
);

#CMS,Newsletter,Wyslij_wiadomosc,1.html
$r[\'cmsNewsletterWyslijWiadomoscAction\'] = new Zend_Controller_Router_Route_Regex(
	\'CMS,Newsletter,Wyslij_wiadomosc,([^-]*)\.html\',
    array( \'action\' => \'wyslijwiadomosc\', \'controller\' => \'newsletter\', \'module\' => \'cms\' ),
    array( 1 => \'id\' ),
	\'CMS,Newsletter,Wyslij_wiadomosc,%d.html\'
);

#CMS,Newsletter,Listuj_adresy_email,1.html
$r[\'cmsNewsletterListujAdresyEmailAction\'] = new Zend_Controller_Router_Route_Regex(
	\'CMS,Newsletter,Listuj_adresy_email,([^-]*)\.html\',
    array( \'action\' => \'listujadresyemail\', \'controller\' => \'newsletter\', \'module\' => \'cms\' ),
    array( 1 => \'page\' ),
	\'CMS,Newsletter,Listuj_adresy_email,%d.html\'
);

#CMS,Newsletter,Usun_adres_email,1.html
$r[\'cmsNewsletterUsunAdresmailAction\'] = new Zend_Controller_Router_Route_Regex(
	\'CMS,Newsletter,Usun_adres_email,([^-]*)\.html\',
    array( \'action\' => \'usunadresemail\', \'controller\' => \'newsletter\', \'module\' => \'cms\' ),
    array( 1 => \'id\' ),
	\'CMS,Newsletter,Usun_adres_email,%d.html\'
);

#CMS,Newsletter,Dodaj_adres_email.html
$r[\'cmsNewsletterDodajAdresmailAction\'] = new Zend_Controller_Router_Route_Regex(
	\'CMS,Newsletter,Dodaj_adres_email.html\',
    array( \'action\' => \'dodajadresemail\', \'controller\' => \'newsletter\', \'module\' => \'cms\' ),
    array(  ),
	\'CMS,Newsletter,Dodaj_adres_email.html\'
);

#CMS,Newsletter,Edytuj_adres_email,1.html
$r[\'cmsNewsletterEdytujAdresmailAction\'] = new Zend_Controller_Router_Route_Regex(
	\'CMS,Newsletter,Edytuj_adres_email,([^-]*)\.html\',
    array( \'action\' => \'edytujadresemail\', \'controller\' => \'newsletter\', \'module\' => \'cms\' ),
    array( 1 => \'id\' ),
	\'CMS,Newsletter,Edytuj_adres_email,%d.html\'
);

$router->addRoutes( $r );

';




array_push($dirs,
'/application/modules/default/views/scripts/newsletter',
'/application/modules/cms/views/scripts/newsletter'
);


$files = $files+array('/application/forms/NewsletterForm.php' => $NewsletterForm);
$files = $files+array('/application/modules/default/controllers/NewsletterController.php' => $defaultNewsletterController);
$files = $files+array('/application/modules/default/views/helpers/DodajEmail.php' => $defaultHelperDodajEmail);
$files = $files+array('/application/modules/default/views/scripts/newsletter/dodajemail.phtml' => $defaultDodajemail_phtml);
$files = $files+array('/application/modules/cms/controllers/NewsletterController.php' => $cmsNewsletterController);
$files = $files+array('/application/modules/cms/views/scripts/_partials/adresy-listing.phtml' => $adresy_listing_phtml);
$files = $files+array('/application/modules/cms/views/scripts/_partials/aktualnoscinewsletter-listing.phtml' => $aktualnoscinewsletter_listing_phtml);
$files = $files+array('/application/modules/cms/views/scripts/newsletter/podgladwiadomosci.phtml' => $podgladwiadomosci_phtml);
$files = $files+array('/application/modules/cms/views/scripts/newsletter/listujaktualnoscinewsletter.phtml' => $listujaktualnoscinewsletter_phtml);
$files = $files+array('/application/modules/cms/views/scripts/newsletter/listujadresyemail.phtml' => $listujadresyemail_phtml);
$files = $files+array('/application/modules/cms/views/scripts/newsletter/aktualnosciadresy.phtml' => $aktualnosciadresy_phtml);
$files = $files+array('/application/modules/cms/views/scripts/newsletter/dodajadresemail.phtml' => '<?php echo $this->form; ?>');
$files = $files+array('/application/modules/cms/views/scripts/newsletter/edytujadresemail.phtml' => '<?php echo $this->form; ?>');
$files = $files+array('/application/routers/defaultNewsletterRouters.php' => $defaultNewsletterRouters);
$files = $files+array('/application/routers/cmsNewsletterRouters.php' => $cmsNewsletterRouters);

array_push($f_doklej_przed,
'/application/modules/default/layouts/layout.phtml(*)<?php $this->ListujStrony(); ?>(*)<?php $this->DodajEmail(); ?>'
);

array_push($f_doklej_za, 
'/public/index.php(*)include_once \'cmsRouters.php\';(*)include_once \'defaultNewsletterRouters.php\'; include_once \'cmsNewsletterRouters.php\'; '
);

//----------------------------Doklejanie menu dla acla--------------------------------------------------//
array_push($f_doklej_przed,'/application/modules/cms/layouts/AclMenuGlowne.phtml(*)//--Oznaczenie_miejsca_przed1-------//(*)else if ($this->pid==\'newsletter\')
{
	$newsletter = \'current\';
}');
array_push($f_doklej_przed,'/application/modules/cms/layouts/AclMenuGlowne.phtml(*)//--Oznaczenie_miejsca_przed2-------//(*)echo $this->AclMenuHelper(
							array(\'router\' => \'cmsNewsletterAktualnosciAdresyAction\',
								  \'params\' => array(),
								  \'content\' => \'Newsletter\',
								  \'resource\' => \'cmsnewsletteraktualnosciadresy\',
									\'acl\' => $this->acl,
								  \'role\' => $role->{\'rola\'},
								  \'privilege\' => \'aktualnosciadresy\',
									\'controller\' => \'newsletter\',
									\'action\' => \'aktualnosciadresy\',
									\'attribs\' => array(\'class\' => $newsletter)
							),\'l\'//----wyrzuca listę
						);');
array_push($f_doklej_przed,'/application/modules/cms/views/helpers/AclMenuOtherHelper.php(*)//--Oznaczenie_miejsca_przed1-------//(*)else if ($p_modul==\'newsletter\')
		{
			//-------------Edycja---------------------------//
			if ($p_kod == 1)
			{
				
				return $this->MenuHelper(
								array(\'router\' => \'cmsNewsletterEdytujAdresmailAction\',
									  \'params\' => array(\'id\' => $p_id),
									  \'content\' => \'<img alt="Edytuj" src="\'.$bUrl.\'/files/img_panel/pencil.png" style="border: 0; padding-right: 10px;" />\',
									  \'resource\' => \'cmsnewsletteredytujadresemail\',
										\'acl\' => $p_acl,
									  \'role\' => $role->{\'rola\'},
									  \'privilege\' => \'edytujadresemail\',
										\'controller\' => \'newsletter\',
										\'action\' => \'edytujadresemail\',
									\'attribs\' => array()
								),\'a\'
							);
				
			}
			//-------------Usuwanie---------------------------//
			else if ($p_kod==2)
			{
				return $this->MenuHelper(
								array(\'router\' => \'cmsNewsletterUsunAdresmailAction\',
									  \'params\' => array(\'id\' => $p_id),
									  \'content\' => \'<img alt="Usuń" src="\'.$bUrl.\'/files/img_panel/ico_kosz.gif" style="border: 0; padding-right: 10px;" />\',
									  \'resource\' => \'cmsnewsletterusunadresemail\',
										\'acl\' => $p_acl,
									  \'role\' => $role->{\'rola\'},
									  \'privilege\' => \'usunadresemail\',
										\'controller\' => \'newsletter\',
										\'action\' => \'usunadresemail\',
									\'attribs\' => array()
								),\'a\'
							);				
			}
			//-------------Dodawanie---------------------------//
			else if ($p_kod==3)
			{
				return $this->MenuHelper(
								array(\'router\' => \'cmsNewsletterDodajAdresmailAction\',
									  \'params\' => array(),
									  \'content\' => \'<img alt="Dodaj" src="\'.$bUrl.\'/files/img_panel/dodajstrone.jpeg" style="border: 0; float: left;" />\',
									  \'resource\' => \'cmsnewsletterdodajadresemail\',
										\'acl\' => $p_acl,
									  \'role\' => $role->{\'rola\'},
									  \'privilege\' => \'dodajadresemail\',
										\'controller\' => \'newsletter\',
										\'action\' => \'dodajadresemail\',
									\'attribs\' => array()
								),\'a\'//---Wyrzuca zwykły link
							);				
			}
			//-------------Podgląd wiadomosci-------------------//
			else if ($p_kod==4)
			{
				return $this->MenuHelper(
								array(\'router\' => \'cmsNewsletterPodgladWiadomosciAction\',
									  \'params\' => array(\'id\' => $p_id),
									  \'content\' => \'<img alt="Wyślij" src="\'.$bUrl.\'/files/img_panel/mail.gif" style="border: 0; float: left;" />\',
									  \'resource\' => \'cmsnewsletterpodgladwiadomosci\',
										\'acl\' => $p_acl,
									  \'role\' => $role->{\'rola\'},
									  \'privilege\' => \'podgladwiadomosci\',
										\'controller\' => \'newsletter\',
										\'action\' => \'podgladwiadomosci\',
									\'attribs\' => array()
								),\'a\'//---Wyrzuca zwykły link
							);				
			}
		}');
